eval(read('/apps/notex.jsx'));
notex.usage('The service administration service',
            {username: 'The "admin/services" service username',
             password: 'The "admin/services" service password',
             action: 'The action to perform',
             service: 'JSON format of a service to update or add'});
notex.service.auth('admin/services');

// Setup database options
var options; eval('options=' + read('../options.jsx'));

// Handle service inserts, updates, deletes and selects
var action = param('action') || 'select';
var service = param('service'); if (service) eval('service=' + service);
var result = notex.service.orm.action(action, 'services', service, options);
write(result.toXMLString());

// END
